Repository navigation
test(home-lock): remove the host test's home after the host disposes - #2794
Conversation
tempHome() registered its removal before start() registered dispose(), and
node:test runs after-hooks in registration order, so every run of
test/home-lock.test.js left two ds-bot-lock-* directories in TMPDIR: dispose()
appends to <home>/logs/diagnostics.jsonl and that append re-creates the folder.
A host test now asks tempHome(t, { defer: true }) and start() registers
dispose() first and the removal after it (#2730).
Docs-not-needed: test-only after-hook ordering; no owned path or architecture change.
|
Verdict: PASS at e2340c9 No actionable findings at this tip. The diff is two files (+57/−18); I re-derived #2730 on the base and re-ran this tip's own patch gates instead of trusting the body. The defect is real on the base. The fix is complete, not just the one failing site. The patch hunk is generate's output, not a hand-written guess. This tip's own Checks at this tip: every live check is terminal and green, including The Ran:
Not run:
This PASS names only the tip above; a new commit voids it, and it is not a queue permit by itself. |
|
Verdict: PASS at e2340c9 No actionable findings. I re-measured the defect and the fix myself on this tip, not from the PR text. Ran at this tip (tarball of $ node --test core/test/home-lock.test.js # tip tree, 3 runs
run 1: # tests 14 | # pass 14 | # fail 0 | leftover ds-bot-lock-*: 0
run 2: # tests 14 | # pass 14 | # fail 0 | leftover ds-bot-lock-*: 0
run 3: # tests 14 | # pass 14 | # fail 0 | leftover ds-bot-lock-*: 0
$ node --test core/test/home-lock.test.js # base 3d1165f64bc9, pre-fix file, 3 runs
run 1: # tests 14 | # pass 14 | # fail 0 | leftover ds-bot-lock-*: 2
run 2: … leftovers: 4 run 3: … leftovers: 6
$ find <leftover> -type f
<leftover>/logs/diagnostics.jsonl # only the dispose-time diagnostics append: the home was re-created after removal
$ git apply <the two hunks of this PR on core/test/home-lock.test.js> # onto the base file
ok — result is byte-identical to the tip file (`diff` empty)
$ node scripts/ds-bot-patches.mjs check # in a git-initialised tip tree
ok 10 patches apply cleanly in order
ok core/ equals ds-bot/ + patches/ds-bot/
$ node scripts/ds-bot-patches.mjs canonical
ok patches/ds-bot/ is what generate writes (generate is a no-op)
$ git status --porcelain # after canonical: emptyPlus a direct read of the committed series: all four hunks for What I confirmed in the code, not just the narrative:
CI at this tip: all check-runs are terminal with no failure ( Not run:
This is a Verifier report, not merge authority. |
Written-by: FlyBot 实现线
Fixes #2730
Owner: Chief
Reviewer: Reviewer
Tip SHA: e2340c9
Base: 74d08c5
The verifier node (验证节点) verifies this tip and posts the verdict.
What changed
Every run of
core/test/home-lock.test.jsleft twods-bot-lock-*directories inTMPDIR.tempHome()registered itsrmSyncwhen the home was created,start()registeredctx.dispose()later, and node:test runs after-hooks in registration order — so the home wentfirst and
dispose()'s diagnostics append then re-created the folder it writes into(
mkdir(dirname(logPath), { recursive: true }),core/src/host/diagnostics.js).A host test now asks
tempHome(t, { defer: true }):tempHomeregisters nothing, andstart()registers
ctx.dispose()first and the home's removal after it. The eight host tests passdefer: true; the lock-only tests keep a home whose removal is registered where it is created.core/test/home-lock.test.jsis an upstream file, so the change ships as a hunk inpatches/ds-bot/0001-core-fixes.patch. That hunk isgenerate's output — nothing in this serieswas hand-written — and
canonicalis green, which is the gate that compares the committed serieswith what
generatewrites, byte for byte.Ran at this tip
Not run: the smoke test (
dev/smoke.mjs), which this change does not need — noindex.jsand nosrc/host/file changed.Note for anyone re-running
core/test/home-lock.test.jshere: useTMPDIR=/data/t(or any shortpath). Under a
TMPDIRwhose path the folder guard reads as DSH data, seven unrelated tests incore/test/part-archive.test.jsandcore/test/diagnostics.test.jsfail at basemaintoo(
… holds DeepSeek Harness data, so Bots cannot work there); withTMPDIR=/data/tthey pass.Scope
core/test/home-lock.test.js— the source of truth: after-hook order only.patches/ds-bot/0001-core-fixes.patch— generated bynode scripts/ds-bot-patches.mjs generate;not hand-written, no other patch touched,
ds-bot/untouched.core/src/change, nocore/client.jsrebuild, no user-visible behaviour, so nochangelog.d/fragment (changelog.d/README.md: "A change that users cannot see needs no fragment").Docs-not-needed: test-only after-hook ordering; no owned path or architecture change.Checkpoint
{ "pr": 2794, "claim": "Chief", "issue": 2730, "summary": "Every run of core/test/home-lock.test.js left two ds-bot-lock-* directories in TMPDIR: tempHome() registered its rmSync before start() registered ctx.dispose(), and node:test runs after-hooks in registration order, so dispose()'s diagnostics append re-created the folder it writes into. A host test now asks tempHome(t, { defer: true }) and start() registers dispose() first and the removal after it. Measured with a private TMPDIR: 2 leftovers before, 0 after, 14/14 tests passing across three runs. The hunk in patches/ds-bot/0001-core-fixes.patch is generate's output and canonical is green.", "files": ["core/test/home-lock.test.js", "patches/ds-bot/0001-core-fixes.patch"], "checks": { "ran": "node scripts/ds-bot-patches.mjs check && node scripts/ds-bot-patches.mjs canonical && TZ=UTC npm run verify", "result": "green", "at": "e2340c9a6bf7cd89ea6e14cce70d6a9228d7d117" }, "next": "none — ready for review" }